package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.wx.PicTxtMessage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PicTxtMessageDao {

    @Insert("insert into pictxtmessage(id,title,description,picurl,url,belong,insertTime,updateTime)" +
            " values(#{id},#{title},#{description},#{picurl},#{url},#{belong},#{insertTime},#{updateTime})")
    int insert(PicTxtMessage picTxtMessage);

    @Select("select * from pictxtmessage where id=#{id}")
    PicTxtMessage queryById(String id);

    @Delete("delete from pictxtmessage where id=#{id}")
    int delete(String id);

    @Delete("delete from pictxtmessage where belong=#{belong}")
    int deleteByBelong(String belong);

    @Select("select * from pictxtmessage where belong=#{belong}")
    List<PicTxtMessage> queryByBelong(String id);
}
